﻿@model GsifWeb4.ViewModels.MatchViewModel

@using (Html.BeginForm())
{
    @Html.ValidationSummary(true)
        
    <fieldset>
        <legend>Match</legend>

        <div class="editor-label">
            @Html.Label("Datum")
        </div>
        <div class="editor-field-short">
            @Html.TextBoxFor(m => Model.Match.Datum, new { @id = "datepicker", @Value = Model.Match.Datum.HasValue ? Model.Match.Datum.Value.ToString("yyyy-MM-dd") : "" })
            @Html.ValidationMessageFor(model => model.Match.Datum)
        </div>

        <div class="editor-label">
            @Html.Label("Lag")
        </div>
        <div class="editor-field">
            @Html.DropDownList("TeamDD", Model.Teams)
            @Html.ValidationMessage("TeamDD", "*")
        </div>

        <div class="editor-label">
            @Html.Label("Motståndare")
        </div>
        <div class="editor-field">
            @Html.TextBoxFor(model => model.Match.Motstandare)
            @Html.ValidationMessageFor(model => model.Match.Motstandare)
        </div>

        <div class="editor-label">
            @Html.Label("Plan")
        </div>
        <div class="editor-field">
            @Html.DropDownList("PlanDD", Model.HomeOrAway)
            @Html.ValidationMessage("PlanDD", "*")
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.Match.Plats)
        </div>
        <div class="editor-field">
            @Html.TextBoxFor(model => model.Match.Plats)
            @Html.ValidationMessageFor(model => model.Match.Plats)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.Match.Tid)
        </div>
        <div class="editor-field-short">
            @Html.TextBoxFor(model => model.Match.Tid)
            @Html.ValidationMessageFor(model => model.Match.Tid)
        </div>

        <div class="editor-label">
            @Html.Label("Typ av match:")
        </div>
        <div>
            @Html.DropDownList("MatchTypeDD", Model.TypeOfGame)
            @Html.ValidationMessage("MatchTypeDD", "*")
        </div>

        <p>
            <input type="submit" value="Save" />
        </p>
    </fieldset>
}
